<?php echo anchor('', T_($this->name)); ?>

<?php echo form_open('/'.$this->curl.'/finance/', 'id="myform" name="myform"')?>

<span class="text_bold">From Date</span>
<?php echo form_input('from_date', $from_date, 'id="from_date" class="input-text" size="20"')?>
<input id="btn_from_date" type="button" style="margin:0;padding:0;width:26px;height:20px" value="..."  />

<span class="text_bold">To Date</span>
<?php echo form_input('to_date', $to_date, 'id="to_date" class="input-text" size="20"')?>
<input id="btn_to_date" type="button" style="margin:0;padding:0;width:26px;height:20px" value="..."  />

<input type="submit" id="btn_save" value="Submit" class="input-submit" name="save">
  			
<table width="100%" border="0" cellpadding="3" cellspacing="0" id="grid" class="display">
<thead>
<tr>	
	<th><?php echo $this->reports_model->fields['calls_type'] ?></th>
	<th><?php echo $this->reports_model->fields['call_date'] ?></th>	
	<th><?php echo $this->reports_model->fields['call_time'] ?></th>	
	<th><?php echo $this->reports_model->fields['add_money'] ?></th>
	<th><?php echo $this->reports_model->fields['take_money'] ?></th>
	<th><?php echo $this->reports_model->fields['cost_advertisers'] ?></th>	
	<th><?php echo $this->reports_model->fields['cost_sms'] ?></th>	
	<th><?php echo $this->reports_model->fields['cost_email'] ?></th>
</tr>
</thead>
<tbody>
<?php
$num = 1;
foreach ($table_list as $row): ?>
<tr id="tr_<?php echo $num?>">
	<td><?php echo $num ++ ?></td>
	<td><?php echo T_($row->calls_type)?></td>	
	<td><?php echo T_($row->call_date)?></td>
	<td class="t-right"><?php echo T_($row->call_time)?></td>	
	<td class="t-right"><?php echo T_($row->add_money)?></td>	
	<td class="t-right"><?php echo T_($row->take_money)?></td>	
	<td class="t-right"><?php echo T_($row->cost_advertisers)?></td>
	<td class="t-right"><?php echo T_($row->cost_sms)?></td>
	<td class="t-right"><?php echo T_($row->cost_email)?></td>	
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
	<tr>
		<th></th>		
		<th id="id_calls_type"></th>
		<th id="id_call_date"></th>
		<th id="id_call_time"></th>
		<th></th>
		<th></th>		
	</tr>
</tfoot>
</table>
<?php /*$this->load->view('_elements/query_no_rows', $list);*/ ?>
	


<?php /*echo $this->pagination->create_links('spc');*/?>



<script type="text/javascript" charset="utf-8">

	/* Charts */
	var requiredMajorVersion = 10;
	var requiredMinorVersion = 0;
	var requiredRevision = 45;

	if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
		if(hasRightVersion) { 
			AC_FL_RunContent(
				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,45,2',
				'width', '400',
				'height', '250',
				'scale', 'noscale',
				'salign', 'TL',
				'bgcolor', '#777788',
				'wmode', 'opaque',
				'movie', 'charts',
				'src', '/js/charts/charts',
				'FlashVars', 'library_path=/js/charts/charts_library&xml_source=/admin/reports/getFinanceXML/', 
				'id', 'my_chart',
				'name', 'my_chart',
				'menu', 'true',
				'allowFullScreen', 'true',
				'allowScriptAccess','sameDomain',
				'quality', 'high',
				'align', 'middle',
				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				'play', 'true',
				'devicefont', 'false'
				); 
		} else { 
			var alternateContent = 'This content requires the Adobe Flash Player. '
			+ '<u><a href=http://www.macromedia.com/go/getflash/>Get Flash</a></u>.';
			document.write(alternateContent); 
		}
	}
	

	/* Calendar */
	var cal = Calendar.setup({
		onSelect: function(cal) { cal.hide() }
	});
	cal.manageFields("btn_from_date", "from_date", "%Y-%m-%d");
	cal.manageFields("btn_to_date", "to_date", "%Y-%m-%d");	

	/* Table Grid */
	var oTable;

	$(document).ready(function() {										
		/* Init DataTables */
		oTable = $('#grid').dataTable(
		{
			"oLanguage": {
			"sLengthMenu": "Показывать _MENU_ записей на стр.",
			"sZeroRecords": "Нет данных.",
			"sInfo": "От _START_ до _END_ из _TOTAL_ записей",
			"sInfoEmpty": "0 записей",
			"sInfoFiltered": "(filtered from _MAX_ total records)",
			"sSearch": "Искать",
			"oPaginate": {
				"sFirst": "Первая",
				"sLast": "Последняя",
				"sNext": "Вперед",
				"sPrevious": "Back"
				}
			},
			
			"aaSorting": [[ 0, "asc" ]],				
			"aoColumns": [
	  			{ "bSortable": true },
	  			{ "bSortable": false },
	  			{ "bSortable": false },
	  			{ "bSortable": false }
	  		],
																
			"bPaginate": true,
			"bLengthChange": true,
			"bFilter": false,	
			"bSort": true,
			"bInfo": true,
			"bAutoWidth": true,
			"bJQueryUI": true,
			"sPaginationType": "full_numbers"
		});
});	
</script>
<?php echo form_close()?>